// 写一个基本的Vuex
import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
    state: {
        token: uni.getStorageSync('token') || '',
    },
    mutations: {
        setToken(state, token) {
            state.token = token
            uni.setStorageSync('token', token)
        },
        removeToken(state) {
            state.token = ''
            uni.removeStorageSync('token')
        }
    }
})



